#ifndef	__d3dUtilityH__
#define	__d3dUtilityH__

#include <d3dx9.h>

namespace d3d
{

	template<class T>
	void Release( T t)
	{
		if( t)
		{
			t->Release();
			t = 0;
		}
	}

	
	template<class T>
	void Delete(T t)
	{
		if( t )
		{
			delete t;
			t = 0;
		}
	}


	const	D3DXCOLOR	WHITE(D3DCOLOR_XRGB(255,255,255));
	const	D3DXCOLOR	BLACK(D3DCOLOR_XRGB(  0,  0,  0));
	const	D3DXCOLOR	RED(D3DCOLOR_XRGB(255,0,0));
	const	D3DXCOLOR	GREEN(D3DCOLOR_XRGB(0,255,0));
	const	D3DXCOLOR	BLUE(D3DCOLOR_XRGB(0,0,255));
	const	D3DXCOLOR	YELLOW(D3DCOLOR_XRGB(255,255,0));
	const	D3DXCOLOR	CYAN(D3DCOLOR_XRGB(0,255,255));
	const	D3DXCOLOR	MAGENTA(D3DCOLOR_XRGB(255,0,255));

	//
	//	Lights
	//
	D3DLIGHT9	InitDirectionalLight(D3DXVECTOR3* direction,D3DXCOLOR*	color);
	D3DLIGHT9	InitPointLight(D3DXVECTOR3* position,D3DXCOLOR* color);
	D3DLIGHT9	InitSpotLight(D3DXVECTOR3* position,D3DXVECTOR3* direction,D3DXCOLOR* color);
};
#endif	//	__d3dUtilityH__